home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / QuickTimeVRFormat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  15.0 KB  |  491 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        QuickTimeVRFormat.h
  3.  
  4.      Contains:    QuickTime VR interfaces
  5.  
  6.      Version:    Technology:    QuickTime VR 2.1
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __QUICKTIMEVRFORMAT__
  19. #define __QUICKTIMEVRFORMAT__
  20.  
  21. #ifndef __CONDITIONALMACROS__
  22. #include <ConditionalMacros.h>
  23. #endif
  24. #ifndef __DIALOGS__
  25. #include <Dialogs.h>
  26. #endif
  27. #ifndef __MOVIES__
  28. #include <Movies.h>
  29. #endif
  30. #ifndef __QUICKTIMEVR__
  31. #include <QuickTimeVR.h>
  32. #endif
  33.  
  34.  
  35.  
  36. #if PRAGMA_ONCE
  37. #pragma once
  38. #endif
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. #if PRAGMA_IMPORT
  45. #pragma import on
  46. #endif
  47.  
  48. #if PRAGMA_STRUCT_ALIGN
  49.     #pragma options align=mac68k
  50. #elif PRAGMA_STRUCT_PACKPUSH
  51.     #pragma pack(push, 2)
  52. #elif PRAGMA_STRUCT_PACK
  53.     #pragma pack(2)
  54. #endif
  55.  
  56.  
  57. /* File Format Version numbers */
  58. #define kQTVRMajorVersion (2)
  59. #define kQTVRMinorVersion (0)
  60.  
  61. /* User data type for the Movie Controller type specifier*/
  62.  
  63. enum {
  64.     kQTControllerType            = kQTVRControllerSubType,        /* Atom & ID of where our*/
  65.     kQTControllerID                = 1                                /* ...controller name is stored*/
  66. };
  67.  
  68. /* VRWorld atom types*/
  69.  
  70. enum {
  71.     kQTVRWorldHeaderAtomType    = FOUR_CHAR_CODE('vrsc'),
  72.     kQTVRImagingParentAtomType    = FOUR_CHAR_CODE('imgp'),
  73.     kQTVRPanoImagingAtomType    = FOUR_CHAR_CODE('impn'),
  74.     kQTVRObjectImagingAtomType    = FOUR_CHAR_CODE('imob'),
  75.     kQTVRNodeParentAtomType        = FOUR_CHAR_CODE('vrnp'),
  76.     kQTVRNodeIDAtomType            = FOUR_CHAR_CODE('vrni'),
  77.     kQTVRNodeLocationAtomType    = FOUR_CHAR_CODE('nloc'),
  78.     kQTVRCursorParentAtomType    = FOUR_CHAR_CODE('vrcp'),        /* New with 2.1*/
  79.     kQTVRCursorAtomType            = FOUR_CHAR_CODE('CURS'),        /* New with 2.1*/
  80.     kQTVRColorCursorAtomType    = FOUR_CHAR_CODE('crsr')        /* New with 2.1*/
  81. };
  82.  
  83. /* NodeInfo atom types*/
  84.  
  85. enum {
  86.     kQTVRNodeHeaderAtomType        = FOUR_CHAR_CODE('ndhd'),
  87.     kQTVRHotSpotParentAtomType    = FOUR_CHAR_CODE('hspa'),
  88.     kQTVRHotSpotAtomType        = FOUR_CHAR_CODE('hots'),
  89.     kQTVRHotSpotInfoAtomType    = FOUR_CHAR_CODE('hsin'),
  90.     kQTVRLinkInfoAtomType        = FOUR_CHAR_CODE('link')
  91. };
  92.  
  93. /* Miscellaneous atom types*/
  94.  
  95. enum {
  96.     kQTVRStringAtomType            = FOUR_CHAR_CODE('vrsg'),
  97.     kQTVRStringEncodingAtomType    = FOUR_CHAR_CODE('vrse'),        /* New with 2.1*/
  98.     kQTVRPanoSampleDataAtomType    = FOUR_CHAR_CODE('pdat'),
  99.     kQTVRObjectInfoAtomType        = FOUR_CHAR_CODE('obji'),
  100.     kQTVRImageTrackRefAtomType    = FOUR_CHAR_CODE('imtr'),        /* Parent is kQTVRObjectInfoAtomType. Required if track ref is not 1 as required by 2.0 format.*/
  101.     kQTVRHotSpotTrackRefAtomType = FOUR_CHAR_CODE('hstr'),        /* Parent is kQTVRObjectInfoAtomType. Required if track ref is not 1 as required by 2.0 format.*/
  102.     kQTVRAngleRangeAtomType        = FOUR_CHAR_CODE('arng'),
  103.     kQTVRTrackRefArrayAtomType    = FOUR_CHAR_CODE('tref'),
  104.     kQTVRPanConstraintAtomType    = FOUR_CHAR_CODE('pcon'),
  105.     kQTVRTiltConstraintAtomType    = FOUR_CHAR_CODE('tcon'),
  106.     kQTVRFOVConstraintAtomType    = FOUR_CHAR_CODE('fcon')
  107. };
  108.  
  109.  
  110. enum {
  111.     kQTVRObjectInfoAtomID        = 1,
  112.     kQTVRObjectImageTrackRefAtomID = 1,                            /* New with 2.1, it adds a track reference to select between multiple image tracks*/
  113.     kQTVRObjectHotSpotTrackRefAtomID = 1                        /* New with 2.1, it adds a track reference to select between multiple hotspot tracks*/
  114. };
  115.  
  116. /* Track reference types*/
  117.  
  118. enum {
  119.     kQTVRImageTrackRefType        = FOUR_CHAR_CODE('imgt'),
  120.     kQTVRHotSpotTrackRefType    = FOUR_CHAR_CODE('hott')
  121. };
  122.  
  123. /* Old hot spot types*/
  124.  
  125. enum {
  126.     kQTVRHotSpotNavigableType    = FOUR_CHAR_CODE('navg')
  127. };
  128.  
  129. /* Valid bits used in QTVRLinkHotSpotAtom*/
  130.  
  131. enum {
  132.     kQTVRValidPan                = 1L << 0,
  133.     kQTVRValidTilt                = 1L << 1,
  134.     kQTVRValidFOV                = 1L << 2,
  135.     kQTVRValidViewCenter        = 1L << 3
  136. };
  137.  
  138.  
  139. /* Values for flags field in QTVRPanoSampleAtom*/
  140.  
  141. enum {
  142.     kQTVRPanoFlagHorizontal        = 1L << 0,
  143.     kQTVRPanoFlagLast            = 1L << 31
  144. };
  145.  
  146.  
  147. /* Values for locationFlags field in QTVRNodeLocationAtom*/
  148.  
  149. enum {
  150.     kQTVRSameFile                = 0
  151. };
  152.  
  153.  
  154. /* Header for QTVR track's Sample Description record (vrWorld atom container is appended)*/
  155.  
  156. struct QTVRSampleDescription {
  157.     UInt32                             descSize;                    /* total size of the QTVRSampleDescription*/
  158.     UInt32                             descType;                    /* must be 'qtvr'*/
  159.  
  160.     UInt32                             reserved1;                    /* must be zero*/
  161.     UInt16                             reserved2;                    /* must be zero*/
  162.     UInt16                             dataRefIndex;                /* must be zero*/
  163.  
  164.     UInt32                             data;                        /* Will be extended to hold vrWorld QTAtomContainer*/
  165.  
  166. };
  167. typedef struct QTVRSampleDescription    QTVRSampleDescription;
  168. typedef QTVRSampleDescription *            QTVRSampleDescriptionPtr;
  169. typedef QTVRSampleDescriptionPtr *        QTVRSampleDescriptionHandle;
  170. /*
  171.   =================================================================================================
  172.    Definitions and structures used in the VRWorld QTAtomContainer
  173.   -------------------------------------------------------------------------------------------------
  174. */
  175.  
  176.  
  177. struct QTVRStringAtom {
  178.     UInt16                             stringUsage;
  179.     UInt16                             stringLength;
  180.     unsigned char                     theString[4];                /* field previously named "string"*/
  181. };
  182. typedef struct QTVRStringAtom            QTVRStringAtom;
  183. typedef QTVRStringAtom *                QTVRStringAtomPtr;
  184.  
  185.  
  186. struct QTVRWorldHeaderAtom {
  187.     UInt16                             majorVersion;
  188.     UInt16                             minorVersion;
  189.  
  190.     QTAtomID                         nameAtomID;
  191.     UInt32                             defaultNodeID;
  192.     UInt32                             vrWorldFlags;
  193.  
  194.     UInt32                             reserved1;
  195.     UInt32                             reserved2;
  196. };
  197. typedef struct QTVRWorldHeaderAtom        QTVRWorldHeaderAtom;
  198. typedef QTVRWorldHeaderAtom *            QTVRWorldHeaderAtomPtr;
  199.  
  200. /* Valid bits used in QTVRPanoImagingAtom*/
  201.  
  202. enum {
  203.     kQTVRValidCorrection        = 1L << 0,
  204.     kQTVRValidQuality            = 1L << 1,
  205.     kQTVRValidDirectDraw        = 1L << 2,
  206.     kQTVRValidFirstExtraProperty = 1L << 3
  207. };
  208.  
  209.  
  210. struct QTVRPanoImagingAtom {
  211.     UInt16                             majorVersion;
  212.     UInt16                             minorVersion;
  213.  
  214.     UInt32                             imagingMode;
  215.     UInt32                             imagingValidFlags;
  216.  
  217.     UInt32                             correction;
  218.     UInt32                             quality;
  219.     UInt32                             directDraw;
  220.     UInt32                             imagingProperties[6];        /* for future properties*/
  221.  
  222.     UInt32                             reserved1;
  223.     UInt32                             reserved2;
  224. };
  225. typedef struct QTVRPanoImagingAtom        QTVRPanoImagingAtom;
  226. typedef QTVRPanoImagingAtom *            QTVRPanoImagingAtomPtr;
  227.  
  228. struct QTVRNodeLocationAtom {
  229.     UInt16                             majorVersion;
  230.     UInt16                             minorVersion;
  231.  
  232.     OSType                             nodeType;
  233.     UInt32                             locationFlags;
  234.     UInt32                             locationData;
  235.  
  236.     UInt32                             reserved1;
  237.     UInt32                             reserved2;
  238. };
  239. typedef struct QTVRNodeLocationAtom        QTVRNodeLocationAtom;
  240. typedef QTVRNodeLocationAtom *            QTVRNodeLocationAtomPtr;
  241. /*
  242.   =================================================================================================
  243.    Definitions and structures used in the Nodeinfo QTAtomContainer
  244.   -------------------------------------------------------------------------------------------------
  245. */
  246.  
  247.  
  248. struct QTVRNodeHeaderAtom {
  249.     UInt16                             majorVersion;
  250.     UInt16                             minorVersion;
  251.  
  252.     OSType                             nodeType;
  253.     QTAtomID                         nodeID;
  254.     QTAtomID                         nameAtomID;
  255.     QTAtomID                         commentAtomID;
  256.  
  257.     UInt32                             reserved1;
  258.     UInt32                             reserved2;
  259. };
  260. typedef struct QTVRNodeHeaderAtom        QTVRNodeHeaderAtom;
  261. typedef QTVRNodeHeaderAtom *            QTVRNodeHeaderAtomPtr;
  262.  
  263. struct QTVRAngleRangeAtom {
  264.     Float32                         minimumAngle;
  265.     Float32                         maximumAngle;
  266. };
  267. typedef struct QTVRAngleRangeAtom        QTVRAngleRangeAtom;
  268. typedef QTVRAngleRangeAtom *            QTVRAngleRangeAtomPtr;
  269.  
  270. struct QTVRHotSpotInfoAtom {
  271.     UInt16                             majorVersion;
  272.     UInt16                             minorVersion;
  273.  
  274.     OSType                             hotSpotType;
  275.     QTAtomID                         nameAtomID;
  276.     QTAtomID                         commentAtomID;
  277.  
  278.     SInt32                             cursorID[3];
  279.  
  280.                                                                 /* canonical view for this hot spot*/
  281.     Float32                         bestPan;
  282.     Float32                         bestTilt;
  283.     Float32                         bestFOV;
  284.     QTVRFloatPoint                     bestViewCenter;
  285.  
  286.                                                                 /* Bounding box for this hot spot*/
  287.     Rect                             hotSpotRect;
  288.  
  289.     UInt32                             flags;
  290.     UInt32                             reserved1;
  291.     UInt32                             reserved2;
  292. };
  293. typedef struct QTVRHotSpotInfoAtom        QTVRHotSpotInfoAtom;
  294. typedef QTVRHotSpotInfoAtom *            QTVRHotSpotInfoAtomPtr;
  295.  
  296. struct QTVRLinkHotSpotAtom {
  297.     UInt16                             majorVersion;
  298.     UInt16                             minorVersion;
  299.  
  300.     UInt32                             toNodeID;
  301.  
  302.     UInt32                             fromValidFlags;
  303.     Float32                         fromPan;
  304.     Float32                         fromTilt;
  305.     Float32                         fromFOV;
  306.     QTVRFloatPoint                     fromViewCenter;
  307.  
  308.     UInt32                             toValidFlags;
  309.     Float32                         toPan;
  310.     Float32                         toTilt;
  311.     Float32                         toFOV;
  312.     QTVRFloatPoint                     toViewCenter;
  313.  
  314.     Float32                         distance;
  315.  
  316.     UInt32                             flags;
  317.     UInt32                             reserved1;
  318.     UInt32                             reserved2;
  319. };
  320. typedef struct QTVRLinkHotSpotAtom        QTVRLinkHotSpotAtom;
  321. typedef QTVRLinkHotSpotAtom *            QTVRLinkHotSpotAtomPtr;
  322. /*
  323.   =================================================================================================
  324.    Definitions and structures used in Panorama and Object tracks
  325.   -------------------------------------------------------------------------------------------------
  326. */
  327.  
  328.  
  329. struct QTVRPanoSampleAtom {
  330.     UInt16                             majorVersion;
  331.     UInt16                             minorVersion;
  332.  
  333.     UInt32                             imageRefTrackIndex;            /* track reference index of the full res image track*/
  334.     UInt32                             hotSpotRefTrackIndex;        /* track reference index of the full res hot spot track*/
  335.  
  336.     Float32                         minPan;
  337.     Float32                         maxPan;
  338.     Float32                         minTilt;
  339.     Float32                         maxTilt;
  340.     Float32                         minFieldOfView;
  341.     Float32                         maxFieldOfView;
  342.  
  343.     Float32                         defaultPan;
  344.     Float32                         defaultTilt;
  345.     Float32                         defaultFieldOfView;
  346.  
  347.                                                                 /* Info for highest res version of image track*/
  348.     UInt32                             imageSizeX;                    /* pixel width of the panorama (e.g. 768)*/
  349.     UInt32                             imageSizeY;                    /* pixel height of the panorama (e.g. 2496)*/
  350.     UInt16                             imageNumFramesX;            /* diced frames wide (e.g. 1)*/
  351.     UInt16                             imageNumFramesY;            /* diced frames high (e.g. 24)*/
  352.  
  353.                                                                 /* Info for highest res version of hotSpot track*/
  354.     UInt32                             hotSpotSizeX;                /* pixel width of the hot spot panorama (e.g. 768)*/
  355.     UInt32                             hotSpotSizeY;                /* pixel height of the hot spot panorama (e.g. 2496)*/
  356.     UInt16                             hotSpotNumFramesX;            /* diced frames wide (e.g. 1)*/
  357.     UInt16                             hotSpotNumFramesY;            /* diced frames high (e.g. 24)*/
  358.  
  359.     UInt32                             flags;
  360.     UInt32                             reserved1;
  361.     UInt32                             reserved2;
  362.  
  363. };
  364. typedef struct QTVRPanoSampleAtom        QTVRPanoSampleAtom;
  365. typedef QTVRPanoSampleAtom *            QTVRPanoSampleAtomPtr;
  366. /* Special resolution values for the Image Track Reference Atoms. Use only one value per track reference.*/
  367.  
  368. enum {
  369.     kQTVRFullTrackRes            = kQTVRFullRes,
  370.     kQTVRHalfTrackRes            = kQTVRHalfRes,
  371.     kQTVRQuarterTrackRes        = kQTVRQuarterRes,
  372.     kQTVRPreviewTrackRes        = 0x8000
  373. };
  374.  
  375.  
  376. struct QTVRTrackRefEntry {
  377.     UInt32                             trackRefType;
  378.     UInt16                             trackResolution;
  379.     UInt32                             trackRefIndex;
  380. };
  381. typedef struct QTVRTrackRefEntry        QTVRTrackRefEntry;
  382. /*
  383.   =================================================================================================
  384.    Object File format 2.0
  385.   -------------------------------------------------------------------------------------------------
  386. */
  387.  
  388. enum {
  389.     kQTVRObjectAnimateViewFramesOn = (1L << 0),
  390.     kQTVRObjectPalindromeViewFramesOn = (1L << 1),
  391.     kQTVRObjectStartFirstViewFrameOn = (1L << 2),
  392.     kQTVRObjectAnimateViewsOn    = (1L << 3),
  393.     kQTVRObjectPalindromeViewsOn = (1L << 4),
  394.     kQTVRObjectSyncViewToFrameRate = (1L << 5),
  395.     kQTVRObjectDontLoopViewFramesOn = (1L << 6),
  396.     kQTVRObjectPlayEveryViewFrameOn = (1L << 7),
  397.     kQTVRObjectStreamingViewsOn    = (1L << 8)
  398. };
  399.  
  400.  
  401. enum {
  402.     kQTVRObjectWrapPanOn        = (1L << 0),
  403.     kQTVRObjectWrapTiltOn        = (1L << 1),
  404.     kQTVRObjectCanZoomOn        = (1L << 2),
  405.     kQTVRObjectReverseHControlOn = (1L << 3),
  406.     kQTVRObjectReverseVControlOn = (1L << 4),
  407.     kQTVRObjectSwapHVControlOn    = (1L << 5),
  408.     kQTVRObjectTranslationOn    = (1L << 6)
  409. };
  410.  
  411.  
  412. enum {
  413.     kGrabberScrollerUI            = 1,                            /* "Object" */
  414.     kOldJoyStickUI                = 2,                            /*  "1.0 Object as Scene"     */
  415.     kJoystickUI                    = 3,                            /* "Object In Scene"*/
  416.     kGrabberUI                    = 4,                            /* "Grabber only"*/
  417.     kAbsoluteUI                    = 5                                /* "Absolute pointer"*/
  418. };
  419.  
  420.  
  421.  
  422. struct QTVRObjectSampleAtom {
  423.     UInt16                             majorVersion;                /* kQTVRMajorVersion*/
  424.     UInt16                             minorVersion;                /* kQTVRMinorVersion*/
  425.     UInt16                             movieType;                    /* ObjectUITypes*/
  426.     UInt16                             viewStateCount;                /* The number of view states 1 based*/
  427.     UInt16                             defaultViewState;            /* The default view state number. The number must be 1 to viewStateCount*/
  428.     UInt16                             mouseDownViewState;            /* The mouse down view state.   The number must be 1 to viewStateCount*/
  429.     UInt32                             viewDuration;                /* The duration of each view including all animation frames in a view*/
  430.     UInt32                             columns;                    /* Number of columns in movie*/
  431.     UInt32                             rows;                        /* Number rows in movie*/
  432.     Float32                         mouseMotionScale;            /* 180.0 for kStandardObject or kQTVRObjectInScene, actual degrees for kOldNavigableMovieScene.*/
  433.     Float32                         minPan;                        /* Start   horizontal pan angle in degrees*/
  434.     Float32                         maxPan;                        /* End     horizontal pan angle in degrees*/
  435.     Float32                         defaultPan;                    /* Initial horizontal pan angle in degrees (poster view)*/
  436.     Float32                         minTilt;                    /* Start   vertical   pan angle in degrees*/
  437.     Float32                         maxTilt;                    /* End     vertical   pan angle in degrees*/
  438.     Float32                         defaultTilt;                /* Initial vertical   pan angle in degrees (poster view)    */
  439.     Float32                         minFieldOfView;                /* minimum field of view setting (appears as the maximum zoom effect) must be >= 1*/
  440.     Float32                         fieldOfView;                /* the field of view range must be >= 1*/
  441.     Float32                         defaultFieldOfView;            /* must be in minFieldOfView and maxFieldOfView range inclusive*/
  442.     Float32                         defaultViewCenterH;
  443.     Float32                         defaultViewCenterV;
  444.  
  445.     Float32                         viewRate;
  446.     Float32                         frameRate;
  447.     UInt32                             animationSettings;            /* 32 reserved bit fields*/
  448.     UInt32                             controlSettings;            /* 32 reserved bit fields*/
  449.  
  450. };
  451. typedef struct QTVRObjectSampleAtom        QTVRObjectSampleAtom;
  452. typedef QTVRObjectSampleAtom *            QTVRObjectSampleAtomPtr;
  453. #if OLDROUTINENAMES
  454.  
  455. typedef QTVRStringAtom                     VRStringAtom;
  456. typedef QTVRWorldHeaderAtom             VRWorldHeaderAtom;
  457. typedef QTVRPanoImagingAtom             VRPanoImagingAtom;
  458. typedef QTVRNodeLocationAtom             VRNodeLocationAtom;
  459. typedef QTVRNodeHeaderAtom                 VRNodeHeaderAtom;
  460. typedef QTVRAngleRangeAtom                 VRAngleRangeAtom;
  461. typedef QTVRHotSpotInfoAtom             VRHotSpotInfoAtom;
  462. typedef QTVRLinkHotSpotAtom             VRLinkHotSpotAtom;
  463. typedef QTVRPanoSampleAtom                 VRPanoSampleAtom;
  464. typedef QTVRTrackRefEntry                 VRTrackRefEntry;
  465. typedef QTVRObjectSampleAtom             VRObjectSampleAtom;
  466. #endif  /* OLDROUTINENAMES */
  467.  
  468.  
  469.  
  470.  
  471. #if PRAGMA_STRUCT_ALIGN
  472.     #pragma options align=reset
  473. #elif PRAGMA_STRUCT_PACKPUSH
  474.     #pragma pack(pop)
  475. #elif PRAGMA_STRUCT_PACK
  476.     #pragma pack()
  477. #endif
  478.  
  479. #ifdef PRAGMA_IMPORT_OFF
  480. #pragma import off
  481. #elif PRAGMA_IMPORT
  482. #pragma import reset
  483. #endif
  484.  
  485. #ifdef __cplusplus
  486. }
  487. #endif
  488.  
  489. #endif /* __QUICKTIMEVRFORMAT__ */
  490.  
  491.